<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>相对定位</title>
    <style>
        * {
            margin: 0;
        }

        body {
            padding: 20px;
        }

        div {
            margin: 8px;
            padding: 8px;
        }

        #app {
            border: 1px solid black;
        }

        #app > div:nth-of-type(1) {
            border: 1px dashed red;
            position: relative;
            top: -20px;
            left: 30px;
        }

        #app > div:nth-of-type(2) {
            border: 1px dashed orange;
            position: relative;
        }

        #app > div:nth-of-type(3) {
            border: 1px dashed green;
            position: relative;
            bottom: 20px;
            right: 20px;
        }
    </style>
</head>
<body>


<div id="app">
    <div>盒子一</div>
    <div>盒子二</div>
    <div>盒子三</div>
</div>

</body>
</html>